const template = (`
    <div class="takeComment">
        <textarea @keydown.enter="addComment(getContent,getTime)" name="textarea" class="takeTextField" id="tijiaoText"></textarea>
        <div class="takeSbmComment">
            <input type="button" class="inputs" @click="addComment(getContent,getTime)" value=""/>
            <button @click="getAll">获取所有内容,发送ajax请求</button>
        </div>
    </div>
`);
export default {
    template,
    props:['add-comment','get-all'],
    computed:{
        getContent(){
            const value = document.querySelector('.takeTextField').value;
            document.querySelector('.takeTextField').value = '';
            return value;
        },
        getTime(){
            const time = new Date(Date.now());
            return time.getFullYear()+"-"+
                (time.getMonth()+1).toString().padStart(2,0)+"-"+
                time.getDate().toString().padStart(2,0)+" "+
                time.getHours().toString().padStart(2,0)+":"+
                time.getMinutes().toString().padStart(2,0)+":"+
                time.getSeconds().toString().padStart(2,0);
        },

    }
}